package test;

import iterator.DinerMenu;
import iterator.MenuItem;

import java.util.Iterator;

public class IteratorMain {
    public static void main(String[] args) {
        MenuItem[] menuItems = new MenuItem[]{new MenuItem("麻辣豆腐"), new MenuItem("麻婆豆腐")};
        DinerMenu dinerMenu = new DinerMenu(menuItems);
        Iterator<MenuItem> iterator = dinerMenu.createIterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next().getName());
        }
    }
}
